<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Blog extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('manage_login');
        $this->load->model('manage_mag');
        $this->load->helper('form');
    }

    public function index() {
        $data = $this->manage_login->manageLogin();
        $this->load->view('home/home', $data);
    }
    function xhrBlog(){
        $html = $this->input->post("html");
        $title= $this->input->post("title");
        $sdesc= $this->input->post("sdesc");
        $thumb= $this->input->post("thumb");
        $user_id = $this->input->post("user_id");
        $answer = $this->manage_mag->addArticle($html,$title,$sdesc,$user_id,$thumb);
        echo $answer;
    }
}